package com.apes.scm.masterdata.frame.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * 功能：渠道中心
 *
 * @author HuJianlin
 * @create 2018-03-08 19:23
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = "mas_channel")
public class Channel extends Model {

    @Id
    @Column(name = "ID", nullable = false, length = 32)
    @Comment("渠道编码")
    private String id;  //渠道编码

    @Column(name = "NAME", nullable = false, length = 200)
    @Comment("渠道名称")
    private String name; //渠道名称

    @Column(name = "description", length = 120, nullable = false)
    @Comment("描述")
    private String description;  //描述

    @Column(name = "inner_", nullable = false)
    @Comment("内部标记")
    private boolean inner = true; //内部标记

    @Column(name = "valid", nullable = false, columnDefinition = "number(1,0) default 1")
    @Comment("有效标记")
    private boolean valid = true; //有效

    @Column(name = "type", columnDefinition = "number(1,0) default 0")
    @Comment("类型标记")
    private boolean type = true; //供应商渠道区分
}
